<%@ page language="java" import="java.util.*, com.rmt.www.vo.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
 
	<link href="css/Site.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" language="javascript" src="js/jquery-1.7.1.js"></script>
	<script src="js/jquery-ui-1.8.18.custom.min.js"></script>
		<link href="css/jquery-ui-1.8.18.custom.css" rel="stylesheet"
			type="text/css" />
	<script>
		$(function(){
			
			$( "input:submit, :button").button();
			
			$('input[value="detail"]').click(function(){
				var i=$('input:checked').length;
				if(i!=1){
					alert('please choose exactly one project!');
				}else{
					//window.location.href="admin/detail.jsp";
					var pid;
					var url='detailAction?pid=';
					$('input:checked').each(function(){
						pid=$(this).attr('value');
						url+=pid;
					});
					window.open(url, "_self");
				}
			});
		});
	</script>
	
	<style type="text/css"> 
/* CSS Document */ 

a { 
color: #c75f3e; 
} 

#mytable {  
padding: 0; 
margin: 0; 
} 

caption { 
padding: 0 0 5px 0; 
width: 700px; 
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
text-align: right; 
} 

#mytable th { 
font: bold 14px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #4f6b72; 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
border-top: 1px solid #C1DAD7; 
letter-spacing: 2px; 
text-transform: uppercase; 
text-align: left; 
padding: 6px 6px 6px 12px; 
background: #CAE8EA  no-repeat; 
} 
 
#mytable th.nobg { 
border-top: 0; 
border-left: 0; 
border-right: 1px solid #C1DAD7; 
background: none; 
} 

#mytable td { 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
background: #fff; 
font-size:13px; 
padding: 6px 6px 6px 12px; 
color: #4f6b72; 
} 
/*power by www.winshell.cn*/ 

#mytable td.alt { 
background: #F5FAFA; 
color: #797268; 
} 

#mytable th.spec { 
border-left: 1px solid #C1DAD7; 
border-top: 0; 
background: #fff no-repeat; 
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
} 

#mytable th.specalt { 
border-left: 1px solid #C1DAD7; 
border-top: 0; 
background: #f5fafa no-repeat; 
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #797268; 
} 
</style> 
  </head>
  
  <body>
  <div class='page' id='wrap'>
    <div id="header" style='background-color: #5c87b2'>
            <div id="title">
                <h1>&nbsp;&nbsp;RMT Service for non-administraters</h1>
            </div>
              
            <div id="logindisplay">
                welcome <%=((User)session.getAttribute("currentUser")).getName()%>, <a href='../RMT'>logout</a>
            </div> 
            <br />
            <br />
            <div id="menucontainer">
            
                <ul id="menu">              
                    <li><a href='getProjectsForOthers'>projects</a></li>
                </ul>
            
            </div>
        </div>
   <div id='main'>
   	 <h1>Projects List</h1>
    <br/>
   	<center>
   		 <table id='mytable' align='center'>
        <tr>
            <th>
                choose
            </th>
            <th>
                project name
            </th>
            <th>
                description
            </th>
            <th>
                create time
            </th>
        </tr>
        <s:iterator value="projectList" id="list" status="st">
        <tr>
            <td>
                <input  type="checkbox" value='<s:property value="#list.pid" /> ' />
            </td>
            <td>
                <s:property value="#list.title" /> 
            </td>
            <td>
                <s:property value="#list.description" /> 
            </td>
            <td>
                <s:property value="#list.time" /> 
            </td>
        </tr>
        </s:iterator>
        <tr>
        	<td style='border-bottom: hidden; border-left:hidden; border-right:hidden'><input type="button" value='detail' /></td>
        </tr>
    </table>
   	</center>
    <br />
   </div>
  </div>
  <div class="push"></div>
  	<div id="footer" style="background-color:#5c87b2;">
  	  <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:hidden;background-color:#5c87b2;">							
		<tbody style="border:hidden">
			<tr style="border: hidden">	
				<td width="160" style="border: hidden">&nbsp;</td>											   		<td>									
				<table width="60%" border="0" cellspacing="0" cellpadding="0" style="border:hidden;">	
					<tbody style="border: hidden">
						<tr style="border: hidden">
							<td height="20px"><font color='#ffffff'>©2012 Copyright 南京大学软件学院rmt工程小组</font></td>										
						</tr>										
						<tr style="border: hidden">											
							<td height="20px"><font color='#ffffff'>2012毕业设计：需求管理工具</font></td>	
						</tr>										
						<tr style="border: hidden">					
							<td height="20px"><font color='#ffffff'>项目主页：http://code.google.com/p/rmt-ss/</font></td>		
						</tr>									
					</tbody>
				</table>								
				</td>							
			</tr>						
		</tbody>
	</table>	
  	</div>
  </body>
</html>
